import logging,HTMLTestRunner_cn,yagmail
class Tools():
    def Log(self):
        log = logging.basicConfig(level=logging.INFO,filename='rizhi.log'
                                  ,filemode='w+'
                                  ,format='%(levelname)s %(filename)s %(message)s %(lineno)d')
        return log
    def Baogao(self):
        baogao = HTMLTestRunner_cn.HTMLTestRunner(open('baogao.html','wb'),title='酒仙网报告')
        return baogao

    def Youjian(self):
        aa = yagmail.SMTP(user='3153075207@qq.com',password='qhgbeikriqgjdcei',host='smtp.qq.com')
        aa.send(to='3153075207@qq.com',subject='酒仙网邮件',contents='执行结果',attachments=['./rizhi.log','./baogao.html'])
        aa.close()
